//
// Created by root on 20-1-16.
//

#ifndef WORLDMAGISK_SERVICE_CACHE_H
#define WORLDMAGISK_SERVICE_CACHE_H

#include <map>
#include <string>
#include <jni.h>

class ServiceCache{
public:
    static ServiceCache* GetInstance(){
        static ServiceCache* instance= nullptr;
        if(!instance)
            instance=new ServiceCache();
        return instance;
    }

    void Put(const std::string &name,jobject service);

    jobject Get(const std::string &name);

    std::map<std::string,jobject> mCacheMap;
};
#endif //WORLDMAGISK_SERVICE_CACHE_H
